<template>
    <!-- el-container构建整个页面的框架 -->
    <el-container style="height: 500px; border: 1px solid #eee">
        <!-- el-aside构建左侧的菜单 -->
        <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
            <el-menu router :default-openeds="['1', '2']">
                <el-submenu v-for="(item, index) in $router.options.routes" :index="index + ''">
                    <template slot="title"><i class="el-icon-brush"></i>{{index}}-{{item.name}}</template>
                    <el-menu-item v-for="(subitem, index2) in item.children" v-bind:index="subitem.path"
                                  :class="$route.path==subitem.path?'is-active':''">
                        <template slot="title"><i class="el-icon-brush"></i>{{subitem.name}}</template>
                    </el-menu-item>
                </el-submenu>
            </el-menu>
        </el-aside>

        <el-container>
            <el-main>
                <router-view></router-view>
            </el-main>
        </el-container>
    </el-container>
</template>

<script>
    export default {
        name: "Index"
    }
</script>

<style scoped>

</style>
